<%@ page import="com.bjpowernode.javaweb.jsp.bean.Student" %>
<%@page contentType="text/html;charset=utf-8" %>

<%--算数运算符--%>
${3+2}<br/>
<%--+号运算符只做求和，不会做字符串拼接，转不成数字会报错--%>
${3+"20"}<br/>
\${3+"abc"}<br/>

<%--关系运算符--%>
${"abc"=="abc"}

<%
    Object obj=new Object();
    request.setAttribute("obj1",obj);
    request.setAttribute("obj2",obj);
%>
${obj1==obj2}<br/>

<%
    String s1=new String("hh");
    String s2=new String("hh");
    request.setAttribute("a",s1);
    request.setAttribute("b",s2);
%>
${a==b}<br/> <%-- true--%>

<%
    Object obj1=new Object();
    Object obj2=new Object();
    request.setAttribute("obj1",obj1);
    request.setAttribute("obj2",obj2);
%>
${obj1==obj2}<br/><%-- false--%>

<%
    Student student1=new Student("110","警察");
    Student student2=new Student("110","警察");
    request.setAttribute("stu1",student1);
    request.setAttribute("stu2",student2);
%>
\${stu1==stu2}<br/>
\${stu1 eq stu2}<br/>

\${stu1!=stu2}<br/>

${!(stu1!=stu2)}<br/>
${not(stu1!=stu2)}<br/>

<%--条件运算符--%>
${empty param.username?"对不起，用户名不能为空":"admin"}<br/>

<%--empty运算符--%>
<%--判断是否为空，为空返回true，不为空返回false--%>
${empty param.username}<br/>
${!empty param.username}<br/>